
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_swiper/flutter_swiper.dart';

class MainBannerSwiperVertical extends StatefulWidget {
  @override
  _MainBannerSwiperVerticalState createState() {
    return new _MainBannerSwiperVerticalState();
  }
}

class _MainBannerSwiperVerticalState extends State<MainBannerSwiperVertical> {
  @override
  Widget build(BuildContext context) {
    return new Swiper(
      itemWidth: ScreenUtil.screenWidthDp,
      itemHeight: ScreenUtil.screenHeightDp,
      itemBuilder: _swiperBuilder,
      itemCount: 3,
      scrollDirection: Axis.vertical,
      autoplay: true,
      onTap: (index) {
        print("setState" + index.toString());
      },
      index: 0,
    );
  }

  Widget _swiperBuilder(BuildContext c, int i) {
    List<Widget> images = [
      new Text("通知"),
      new Text("新闻"),
      new Text("警告"),
    ];
    return images[i];
  }
}
